home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / August 96 / Re Undo Set Property.2 < prev    next >
Encoding:
Internet Message Format  |  1996-08-07  |  2.1 KB  |  [TEXT/ttxt]

  1. Subject:     Re:Undo Set Property
  2. Sent:        8/6/96 8:21 PM
  3. Received:    8/7/96 8:55 AM
  4. From:        Greg Friedman, friedman@cognosis.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Serge Froment wrote:
  9. > Dear ODF Experts:
  10. >
  11. > Setting some of the properties of my part do modify other properties and
  12. > this is not taken care by FW_CSetPropertyCommand. This command object is
  13. > created by FW_CPropertyDesignator::DoAESetData, which I cannot figure how
  14. > to override.
  15. >
  16. > Although it may seem strange that properties have side effects on other
  17. > properties, this is natural for my part content.
  18. >
  19. > Is there a solution?
  20.  
  21. I'm not sure you need to override FW_CSetPropertyCommand. When a
  22. FW_CSetPropertyCommand is performed, the SetProperty method of the object
  23. whose property is being set is called. SetProperty is virtual. I suspect
  24. you'll be able to implement the functionality you need by override
  25. SetProperty and/or GetProperty in your part. There is nothing stopping you
  26. from doing whatever you want when these methods are called. I think this
  27. method is the most straightforward, and you should be able to do what you
  28. want.
  29.  
  30. If you _really_ want to mess with FW_CSetProperty command, you'll have to
  31. do more work. You'll need to override the GetContainedObject method of the
  32. scriptable object whose property is being set. Within that method, you'll
  33. need to return a subclass (which you define and implement) of
  34. FW_CPropertyDesignator, that overrides DoAESetData. When your subclass's
  35. DoAESetData method is called, you'll have to create and execute either a
  36. subclass of FW_CSetPropertyCommand, or a subclass of FW_CCommand (that you
  37. define and implement). This subclass can do whatever you want in its DoIt,
  38. UndoIt, and RedoIt method. Be _very_ careful to make sure that you
  39. implement a scheme for reference counting so that objects involved in undo
  40. are kept around when necessary, and are deleted when you are through with
  41. them.
  42.  
  43. Greg.
  44.  
  45.  
  46. _________________________________________________________
  47. Greg Friedman      ODF Engineering       Apple Computer
  48.  
  49.  
  50.